
Page({

  /**
   * 页面的初始数据
   */
  data: {
    schema:[],
    formData:{
    },
    title: '',
    result: '',
    remark: '',
    webUrl: '',
    apiName: '',
    showPrivacy: false
  },
  onLoad(options) {
    console.log('options', options)
    wx.setNavigationBarTitle({
      title: options.title,
    })
    
    this.setData({
      title: options.title,
      zh:options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  },
  getFormData(e) {
    console.log('formdata==', e.detail.formData);
    this.setData({
      formData: e.detail.formData
    })
  },
  requestSubscribeMessage() {
    wx.requestSubscribeMessage({
      tmplIds: ['qZAX81uBsbNg04K-X2j7ICWXfVS9xrUlZfLyZxKR2pY'],
      success: (res) => {
        this.setData({
          result: res
        })
      },
      fail: (res) => {
        this.setData({
          result: res
        })
      }
    })
  },
  requestSubscribeDeviceMessage() {
    wx.requestSubscribeDeviceMessage({
      tmplIds: ['qZAX81uBsbNg04K-X2j7ICWXfVS9xrUlZfLyZxKR2pY'],
      sn: 'xxxx',
      snTicket: 'xxxxx',
      modelId: 'xxx',
      success: (res) => {
        this.setData({
          result: res
        })
      },
      fail: (res) => {
        this.setData({
          result: res
        })
      }
    })
  },
  onUnload() {
  }
})